package net.zisen.cloud.goods.client;

import net.zisen.cloud.base.msg.ResultMsg;
import net.zisen.cloud.goods.model.Goods;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @author tim/278002989@qq.com
 * @Classname GoodsClient
 * @Description TODO
 * @Date 2019-05-17 17:39
 */
@FeignClient(value = "PING-GOODS-PROVIDER")
public interface GoodsClient {


    /**
     * 更新库存
     *
     * @param goodsId
     * @param quality
     * @return
     */
    @RequestMapping(value = "/goods/quality/{goodsId}", method = RequestMethod.GET)
    ResultMsg updateQuality(@PathVariable("goodsId") Long goodsId, @RequestParam Integer quality);

    /**
     * 获取商品信息
     *
     * @param goodsId
     * @return
     */
    @RequestMapping(value = "/goods/{goodsId}", method = RequestMethod.GET)
    ResultMsg<Goods> goodsDetail(@PathVariable("goodsId") Long goodsId);

}
